import Vue from "vue";
import VueRouter from "vue-router";

const Tabbar = () => import("@/components/Tabbar/");
Vue.use(VueRouter);

const routes = [
  {
    path: "/test",
    name: "test",
    component: () => import("@/views/test/test.vue")
  },
  {
    path: "/",
    name: "物资管理",
    component: () => import("@/views/login/Login.vue")
  },
  {
    path: "/login",
    name: "login",
    component: () => import("@/views/login/Login.vue")
  },
  {
    path: "/home",
    name: "home",
    components: {
      default: () => import("@/views/home/TabbarHome.vue"),
      tabbar: Tabbar
    }
  },
  {
    path: "/home/info",
    name: "info",
    component: () => import("@/views/home/ItemInfo.vue")
  },
  {
    path: "/scancode",
    name: "scancode",
    component: () => import("@/views/home/scancode.vue")
  },
  {
    path: "/itemsList",
    name: "itemsList",
    components: {
      default: () => import("@/views/document/DocumentManagerList.vue"),
      tabbar: Tabbar
    }
  },
  {
    path: "/items",
    name: "items",
    components: {
      default: () => import("@/views/document/DocumentManager.vue")
    }
  },
  {
    path: "/items/out",
    name: "itemsOut",
    components: {
      default: () => import("@/views/document/DocumentManagerOut.vue")
    }
  },
  {
    path: "/items/enter",
    name: "itemsEnter",
    components: {
      default: () => import("@/views/document/DocumentManagerEnter.vue")
    }
  },
  {
    path: "/items/move",
    name: "itemsMove",
    components: {
      default: () => import("@/views/document/DocumentManagerMove.vue")
    }
  },
  {
    path: "/items/info/enter",
    name: "enterInfo",
    component: () => import("@/views/document/DocumentInfoEnter.vue")
  },{
    path: "/items/info/move",
    name: "moveInfo",
    component: () => import("@/views/document/DocumentInfoMove.vue")
  },{
    path: "/items/info/out",
    name: "info",
    component: () => import("@/views/document/DocumentInfoOut.vue")
  },{
    path: "/items/info",
    name: "info",
    component: () => import("@/views/document/DocumentInfo.vue")
  },
  {
    path: "/search",
    name: "search",
    component: () => import("@/views/search/Search.vue")
  },
  {
    path: "/documentsearch",
    name: "documentsearch",
    component: () => import("@/views/search/DocumentSearch.vue")
  },
  {
    path: "/documentsearchenter",
    name: "documentsearchenter",
    component: () => import("@/views/search/DocumentSearchEnter.vue")
  },
  {
    path: "/instructionSearch",
    name: "instructionSearch",
    component: () => import("@/views/search/InstructionSearch.vue")
  },
  {
    path: "/order",
    name: "cart",
    components: {
      default: () => import("@/views/instruction/Instruction.vue"),
      tabbar: Tabbar
    }
  },
  {
    path: "/order/info",
    name: "instructioninfo",
    component: () => import("@/views/instruction/InstructionInfo.vue")
  },
  {
    path: "/order/item/info",
    name: "instructioniteminfo",
    component: () => import("@/views/document/DocumentItemInfo.vue")
  },{
    path: "/order/item/info/out",
    name: "instructioniteminfoOut",
    component: () => import("@/views/document/DocumentItemInfoOut.vue")
  },{
    path: "/order/item/info/move",
    name: "instructioniteminfoMove",
    component: () => import("@/views/document/DocumentItemInfoMove.vue")
  },{
    path: "/order/item/info/enter",
    name: "instructioniteminfoEnter",
    component: () => import("@/views/document/DocumentItemInfoEnter.vue")
  },
  {
    path: "/order/list",
    name: "instructioninfolist",
    component: () => import("@/views/instruction/InstructionInfoList.vue")
  },
  {
    path: "/order/info/avg",
    name: "instructioninfolist",
    component: () => import("@/views/instruction/AVGList.vue")
  },
  {
    path: "/order/action",
    name: "InstructionAction",
    component: () => import("@/views/instruction/InstructionAction.vue")
  },
  {
    path: "/order/execution",
    name: "ExecutionInstruction",
    component: () => import("@/views/instruction/ExecutionInstruction.vue")
  },
  {
    path: "/order/assignment",
    name: "assignment",
    component: () => import("@/views/instruction/InstructionAssignment.vue")
  },
  {
    path: "/user",
    name: "user",
    components: {
      default: () => import("@/views/user/User.vue"),
      tabbar: Tabbar
    }
  }
];

const router = new VueRouter({
  // mode: "history",
  // base: process.env.BASE_URL,
  routes
});

export default router;
